package com.authine.cloudpivot.ext.enums.commoditymaterials;

/**
 * 组织询价采购类型
 */

public enum GoodsPurchaseTypeEnum {

    ALL(0, "全部"),
    SINGLE(1, "单次"), // 询价单次采购
    LOOP(2, "循环"); // 询价循环采购

    private Integer id;
    private String text;

    public Integer getId() {
        return id;
    }

    public String getText() {
        return text;
    }

    private GoodsPurchaseTypeEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static GoodsPurchaseTypeEnum get(Integer code) {

        for (GoodsPurchaseTypeEnum c : GoodsPurchaseTypeEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

}